package com.cvnert.testplatform.domain;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

/**
 * 
 * @TableName test_case
 */
@Data
public class TestCase implements Serializable {
    /**
     * 
     */
    @TableId(value = "id" , type = IdType.AUTO)
    private Integer id;

    /**
     * 用例名字
     */
    private String casename;

    /**
     * 用例id
     */
    private Integer cid;

    /**
     * 用例内容
     */
    private String casemain;

    /**
     * 用例描述
     */
    private String casedes;

    /**
     * 用例编辑人
     */
    private Integer uid;

    /**
     * 创建时间
     */
    private LocalDateTime createtime;

    /**
     * 更新时间
     */
    private LocalDateTime updatetime;

    /**
     * 用例是否完成
     */
    private String issuccess;

    @TableField(exist = false)
    private List<User> users;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TestCase other = (TestCase) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCasename() == null ? other.getCasename() == null : this.getCasename().equals(other.getCasename()))
            && (this.getCid() == null ? other.getCid() == null : this.getCid().equals(other.getCid()))
            && (this.getCasemain() == null ? other.getCasemain() == null : this.getCasemain().equals(other.getCasemain()))
            && (this.getCasedes() == null ? other.getCasedes() == null : this.getCasedes().equals(other.getCasedes()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
            && (this.getIssuccess() == null ? other.getIssuccess() == null : this.getIssuccess().equals(other.getIssuccess()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCasename() == null) ? 0 : getCasename().hashCode());
        result = prime * result + ((getCid() == null) ? 0 : getCid().hashCode());
        result = prime * result + ((getCasemain() == null) ? 0 : getCasemain().hashCode());
        result = prime * result + ((getCasedes() == null) ? 0 : getCasedes().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getIssuccess() == null) ? 0 : getIssuccess().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", casename=").append(casename);
        sb.append(", cid=").append(cid);
        sb.append(", casemain=").append(casemain);
        sb.append(", casedes=").append(casedes);
        sb.append(", createtime=").append(createtime);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", issuccess=").append(issuccess);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}